<!DOCTYPE html>
<html lang="en">

    <head><title>RAC的多机Oracle搭建 &ndash; UxiaoTag的博客</title>
<meta name="description" content="一个蒟蒻无比的萌新.">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8"/>



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css" integrity="sha512-1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSLy85pkm9GaYVYMfw5BC1A==" crossorigin="anonymous" />


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.9.1/css/academicons.min.css" integrity="sha512-b1ASx0WHgVFL5ZQhTgiPWX+68KjS38Jk87jg7pe+qC7q9YkEtFq0z7xCglv7qGIs/68d3mAp+StfC8WKC5SSAg==" crossorigin="anonymous" />


<link rel="stylesheet" href="https://juruoxiao.gitee.io/linux_work/css/palettes/base16-dark.css">
<link rel="stylesheet" href="https://juruoxiao.gitee.io/linux_work/css/risotto.css">
<link rel="stylesheet" href="https://juruoxiao.gitee.io/linux_work/css/custom.css">
</head>

    <body>
        <div class="page">

            <header class="page__header"><h1 class="page__logo"><a href="https://juruoxiao.gitee.io/linux_work" class="page__logo-inner">UxiaoTag的博客</a></h1>
<nav class="page__nav main-nav">
    <ul>
    
    
    <li class="main-nav__item"><a class="nav-main-item" href="https://juruoxiao.gitee.io/linux_work/about/" title="">About</a></li>
    
    <li class="main-nav__item"><a class="nav-main-item active" href="https://juruoxiao.gitee.io/linux_work/post/" title="Posts">Posts</a></li>
    
    </ul>
</nav>

</header>

            <section class="page__body">
    <header class="content__header">
        <h1>RAC的多机Oracle搭建</h1>
    </header>
    <div class="content__body">
        <p>主要参考公司的文档，搭一个基于RAC的多机Oracle</p>
<h1 id="额外补充篇搭一个基于rac的多机oracle">额外补充篇:搭一个基于RAC的多机Oracle</h1>
<h2 id="主要参考公司的文档这里只补充报错信息和没做的操作">主要参考公司的文档，这里只补充报错信息和没做的操作</h2>
<p>NUMA未关(有一说一内存优化为什么要关，让其内存CPU交换跑在蓝桥上)</p>
<p>centos7没有compat-libstdc++包，手动下了一个</p>
<pre tabindex="0"><code>	http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
</code></pre><p>按道理我应该根据实际内容修改kerimal的值，但是我懒狗了，就直接套用了</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>kernel.shmall <span style="color:#f92672">=</span> <span style="color:#ae81ff">1073741824</span>      physical RAM size / pagesize
</span></span><span style="display:flex;"><span>kernel.shmmax <span style="color:#f92672">=</span> <span style="color:#ae81ff">4398046511104</span>   1/2 of physical RAM
</span></span></code></pre></div><blockquote>
<p>pam_limits.so模块的主要功能是限制用户会话过程中对各种系统资源的使用情况。缺省情况下该模块的配置文件是/etc/security/limits.conf。
所以在在文档中填入limits.conf相关内容主要是通过limits.so模块来实现。</p>
</blockquote>
<p>要专门开多一张网卡用于内网通信，此处内网是一个概念，最好是真的在内网，这个的意思是俩台机子互相私密通信的ip。在vmware创个网卡，然后手动vim改内容就行。</p>
<p>创建asm的心里路程十分艰辛，裸设备的方法被linux本身抛弃，udev呢无论怎么折腾的磁盘拿不到ssid(可能跟虚拟机有关，我已经改了vms了但是还是报错),千辛万苦找到了asmlib来创建<a href="https://blog.csdn.net/shayuwei/article/details/90481922">这是创建教程网址</a></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm listdisks</span>
</span></span><span style="display:flex;"><span>OCR
</span></span></code></pre></div><p>就算成功了把。。</p>
<p>并没有报了一个错误</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># strace  -f -o asm.out /usr/sbin/oracleasm createdisk OCR /dev/sdb1</span>
</span></span><span style="display:flex;"><span>Writing disk header: <span style="color:#66d9ef">done</span>
</span></span><span style="display:flex;"><span>Instantiating disk: failed
</span></span><span style="display:flex;"><span>Unable to change ownership of disk <span style="color:#e6db74">&#34;/dev/oracleasm/disks/OCR
</span></span></span></code></pre></div><p>找到原因了，在填入group里面填错了。然后填完在另一个节点里面打开asmlib，输入</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>oracleasm scandisk
</span></span></code></pre></div><p>然后开始安装，只需要一个节点装就行，另一个节点安装要删掉，不然会报警。</p>
<p>到检查部分，最后完善后还剩下4个问题 resolv.conf完整性，scan，/dev/shm/DNS名称服务。四项没做好</p>
<p>事实上不需要这四个然后安装就行了，安装可能会遇到：NTP不通过，chronyd不通过和CVU验证不通过。小bug,直接跳了还能用。</p>
<p>最后启动之后执行crsctl status res -t检验gi安装完成。</p>
<p>我当时是反着装的，所以我将rac2改为了+ASM1,之前一直遇到rac2报错问题，找到解决方法了</p>
<p>通过ps -ef|grep pmon发现rac2启动的不是oracle2是1，所以改了oracle用户的sid就解决了问题。顺带一提，rac2的grid中SID也被我改成了+ASM1,建议下次安装在节点一处安装。</p>
<p>安装完成之后就可以装db了，装db就很简单了。</p>
<p>补充一些中文乱码问题，你需要sqlplus调整与服务端编码相同，方法如下：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-SQL" data-lang="SQL"><span style="display:flex;"><span><span style="color:#66d9ef">SQL</span><span style="color:#f92672">&gt;</span> <span style="color:#66d9ef">SELECT</span> <span style="color:#f92672">*</span> <span style="color:#66d9ef">FROM</span> NLS_DATABASE_PARAMETERS;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">PARAMETER</span>                      VALUE
</span></span><span style="display:flex;"><span><span style="color:#75715e">------------------------------ --------------------------------------------------
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>NLS_RDBMS_VERSION              <span style="color:#ae81ff">19</span>.<span style="color:#ae81ff">0</span>.<span style="color:#ae81ff">0</span>.<span style="color:#ae81ff">0</span>.<span style="color:#ae81ff">0</span>
</span></span><span style="display:flex;"><span>NLS_NCHAR_CONV_EXCP            <span style="color:#66d9ef">FALSE</span>
</span></span><span style="display:flex;"><span>NLS_LENGTH_SEMANTICS           BYTE
</span></span><span style="display:flex;"><span>NLS_COMP                       BINARY
</span></span><span style="display:flex;"><span>NLS_DUAL_CURRENCY              <span style="color:#960050;background-color:#1e0010">$</span>
</span></span><span style="display:flex;"><span>NLS_TIMESTAMP_TZ_FORMAT        DD<span style="color:#f92672">-</span>MON<span style="color:#f92672">-</span>RR HH.MI.SSXFF AM TZR
</span></span><span style="display:flex;"><span>NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
</span></span><span style="display:flex;"><span>NLS_TIMESTAMP_FORMAT           DD<span style="color:#f92672">-</span>MON<span style="color:#f92672">-</span>RR HH.MI.SSXFF AM
</span></span><span style="display:flex;"><span>NLS_TIME_FORMAT                HH.MI.SSXFF AM
</span></span><span style="display:flex;"><span>NLS_SORT                       BINARY
</span></span><span style="display:flex;"><span>NLS_DATE_LANGUAGE              AMERICAN
</span></span><span style="display:flex;"><span>NLS_DATE_FORMAT                DD<span style="color:#f92672">-</span>MON<span style="color:#f92672">-</span>RR
</span></span><span style="display:flex;"><span>NLS_CALENDAR                   GREGORIAN
</span></span><span style="display:flex;"><span>NLS_NUMERIC_CHARACTERS         .,
</span></span><span style="display:flex;"><span>NLS_NCHAR_CHARACTERSET         AL16UTF16
</span></span><span style="display:flex;"><span>NLS_CHARACTERSET               ZHS16GBK
</span></span><span style="display:flex;"><span>NLS_ISO_CURRENCY               AMERICA
</span></span><span style="display:flex;"><span>NLS_CURRENCY                   <span style="color:#960050;background-color:#1e0010">$</span>
</span></span><span style="display:flex;"><span>NLS_TERRITORY                  AMERICA
</span></span><span style="display:flex;"><span>NLS_LANGUAGE                   AMERICAN
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ae81ff">20</span> <span style="color:#66d9ef">rows</span> selected.
</span></span></code></pre></div><p>可知编码为AMERICA_ZHS16GBK，通过修改环境变量NLS_LANG=AMERICAN_AMERICA.ZHS16GBK即可解决乱码问题</p>
<p>还有一个问题，使用sqlplus默认的配置查询东西压根看不明白，所以建议先修改linesize和pagesize。</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sql" data-lang="sql"><span style="display:flex;"><span><span style="color:#66d9ef">set</span> linesize <span style="color:#ae81ff">1000</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">set</span> pagesize <span style="color:#ae81ff">100</span>
</span></span></code></pre></div><p>这样看起来起码是能看了，当然，如果需要可以手动设置行的长度</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sql" data-lang="sql"><span style="display:flex;"><span>col <span style="color:#960050;background-color:#1e0010">列名</span> format a30<span style="color:#f92672">/</span><span style="color:#ae81ff">999</span> <span style="color:#f92672">//</span><span style="color:#960050;background-color:#1e0010">前者为</span>varchat类型单位<span style="color:#960050;background-color:#1e0010">，后者为</span>int等类型单位<span style="color:#960050;background-color:#1e0010">。</span>
</span></span></code></pre></div><p>顺带一提，x11转发我使用原生ssh就是起步来，所以我还是用tabby打开x11转发，需要下载x11组件以及相关配置。参考文章<a href="https://blog.csdn.net/weixin_44966641/article/details/120365459">x11转发</a></p>
<h1 id="上面就是安装过程主要被折磨的地方以下是安装的完整流程">上面就是安装过程主要被折磨的地方。以下是安装的完整流程：</h1>
<h2 id="先下载软件包备用">先下载软件包备用</h2>
<p>LINUX.X64_193000_db_home.zip</p>
<p>LINUX.X64_193000_grid_home.zip</p>
<p>compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm</p>
<p>这个rpm是yum install 不到的，所以要单独下</p>
<blockquote>
<p><a href="http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm">http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm</a></p>
</blockquote>
<h2 id="配置系统环境双节点操作">配置系统环境（双节点操作）</h2>
<h2 id="关闭networkmanager">关闭NetworkManager</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>systemctl stop NetworkManager
</span></span><span style="display:flex;"><span>systemctl disable NetworkManager
</span></span><span style="display:flex;"><span>systemctl status NetworkManager
</span></span></code></pre></div><h2 id="关闭防火墙">关闭防火墙</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>systemctl stop firewalld
</span></span><span style="display:flex;"><span>systemctl disable firewalld
</span></span><span style="display:flex;"><span>systemctl status firewalld
</span></span></code></pre></div><h2 id="关闭selinux">关闭selinux</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># vi /etc/selinux/config</span>
</span></span><span style="display:flex;"><span>SELINUX<span style="color:#f92672">=</span>disabled
</span></span></code></pre></div><h2 id="关闭chrony">关闭Chrony</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>systemctl stop chronyd.service
</span></span><span style="display:flex;"><span>systemctl disable chronyd.service
</span></span><span style="display:flex;"><span>systemctl status chronyd.service
</span></span></code></pre></div><h2 id="numa我并没有关闭主要是让内存走过经过南桥太低效了所以我还是保留了numa">NUMA我并没有关闭，主要是让内存走过经过南桥太低效了，所以我还是保留了NUMA</h2>
<blockquote>
<p>NUMA 全称 Non-Uniform Memory Access，译为“非一致性内存访问”。</p>
</blockquote>
<h2 id="安装rpm包">安装rpm包：</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>yum install -y bc binutils gcc gcc-c++ compat-libcap1 compat-libstdc++33 elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libXrender libXrender-devel libX11 libXau libXi libXtst libgcc libstdc++ libstdc++-devel libxcb make smartmontools sysstat vim wget
</span></span><span style="display:flex;"><span>rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
</span></span></code></pre></div><p>这样，起码的安装条件就够了，当然后续还要安装asm磁盘组。还会需要一些包的。</p>
<h2 id="然后就是弄用户组了">然后就是弄用户组了</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>/usr/sbin/groupadd oinstall
</span></span><span style="display:flex;"><span>/usr/sbin/groupadd dba
</span></span><span style="display:flex;"><span>/usr/sbin/useradd -g oinstall -G oinstall,dba oracle
</span></span><span style="display:flex;"><span>/usr/sbin/useradd -g oinstall -G dba grid
</span></span></code></pre></div><h2 id="调整内核参数">调整内核参数</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>vi /etc/sysctl.conf
</span></span><span style="display:flex;"><span>kernel.shmall <span style="color:#f92672">=</span> <span style="color:#ae81ff">1073741824</span>      physical RAM size / pagesize
</span></span><span style="display:flex;"><span>kernel.shmmax <span style="color:#f92672">=</span> <span style="color:#ae81ff">4398046511104</span>   1/2 of physical RAM
</span></span><span style="display:flex;"><span>fs.file-max <span style="color:#f92672">=</span> <span style="color:#ae81ff">6815744</span>
</span></span><span style="display:flex;"><span>kernel.shmmni <span style="color:#f92672">=</span> <span style="color:#ae81ff">4096</span>
</span></span><span style="display:flex;"><span>kernel.sem <span style="color:#f92672">=</span> <span style="color:#ae81ff">250</span> <span style="color:#ae81ff">32000</span> <span style="color:#ae81ff">100</span> <span style="color:#ae81ff">128</span>
</span></span><span style="display:flex;"><span>fs.aio-max-nr <span style="color:#f92672">=</span> <span style="color:#ae81ff">1048576</span>
</span></span><span style="display:flex;"><span>net.ipv4.conf.all.rp_filter <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>
</span></span><span style="display:flex;"><span>net.ipv4.conf.default.rp_filter <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span>
</span></span><span style="display:flex;"><span>net.ipv4.ip_local_port_range <span style="color:#f92672">=</span> <span style="color:#ae81ff">9000</span> <span style="color:#ae81ff">65500</span>
</span></span><span style="display:flex;"><span>kernel.panic_on_oops <span style="color:#f92672">=</span> <span style="color:#ae81ff">1</span>
</span></span><span style="display:flex;"><span>net.core.rmem_default <span style="color:#f92672">=</span> <span style="color:#ae81ff">262144</span>
</span></span><span style="display:flex;"><span>net.core.rmem_max <span style="color:#f92672">=</span> <span style="color:#ae81ff">4194304</span>
</span></span><span style="display:flex;"><span>net.core.wmem_default <span style="color:#f92672">=</span> <span style="color:#ae81ff">262144</span>
</span></span><span style="display:flex;"><span>net.core.wmem_max <span style="color:#f92672">=</span> <span style="color:#ae81ff">1048576</span>
</span></span><span style="display:flex;"><span>执行sysctl -p 命令使以上设置生效 
</span></span></code></pre></div><p>上面也讲了，内核参数按照实际情况进行计算调整，我懒了，所以直接填进去就行了。</p>
<h2 id="编辑etcpamdlogin-添加如下内容">编辑/etc/pam.d/login 添加如下内容：</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>vim /etc/pam.d/login 
</span></span><span style="display:flex;"><span>session    required     pam_limits.so
</span></span></code></pre></div><h2 id="添加系统环境变量">添加系统环境变量：</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>vim /etc/profile
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">if</span> <span style="color:#f92672">[</span> /$USER <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;oracle&#34;</span> <span style="color:#f92672">]</span> <span style="color:#f92672">||</span> <span style="color:#f92672">[</span> /$USER <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;grid&#34;</span> <span style="color:#f92672">]</span>; <span style="color:#66d9ef">then</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> <span style="color:#f92672">[</span> /$SHELL <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;/bin/ksh&#34;</span> <span style="color:#f92672">]</span>; <span style="color:#66d9ef">then</span>
</span></span><span style="display:flex;"><span>        ulimit -p <span style="color:#ae81ff">16384</span>
</span></span><span style="display:flex;"><span>        ulimit -n <span style="color:#ae81ff">65536</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">else</span>
</span></span><span style="display:flex;"><span>        ulimit -u <span style="color:#ae81ff">16384</span> -n <span style="color:#ae81ff">65536</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">fi</span>
</span></span><span style="display:flex;"><span>    umask <span style="color:#ae81ff">022</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">fi</span>
</span></span></code></pre></div><h2 id="编辑etcsecuritylimitsconf-添加如下内容">编辑/etc/security/limits.conf 添加如下内容：</h2>
<pre tabindex="0"><code>vim /etc/security/limits.conf 
grid   soft nproc   2047
grid   hard nproc   16384
grid   soft nofile  1024
grid   hard nofile  65536
grid   soft stack   10240
oracle soft stack   10240
oracle soft nproc   2047
oracle hard nproc   16384
oracle soft nofile  1024
oracle hard nofile  65536
oracle hard memlock 3145728
oracle soft memlock 3145728
</code></pre><h2 id="调整用户变量">调整用户变量：</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>一节点:
</span></span><span style="display:flex;"><span>grid 用户：
</span></span><span style="display:flex;"><span>export ORACLE_BASE<span style="color:#f92672">=</span>/oracle/gridbase
</span></span><span style="display:flex;"><span>export ORACLE_HOME<span style="color:#f92672">=</span>/oracle/grid/crs_1
</span></span><span style="display:flex;"><span>export ORACLE_SID<span style="color:#f92672">=</span>+ASM1
</span></span><span style="display:flex;"><span>export PATH<span style="color:#f92672">=</span>$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>oracle用户：
</span></span><span style="display:flex;"><span>export ORACLE_BASE<span style="color:#f92672">=</span>/oracle/app
</span></span><span style="display:flex;"><span>export ORACLE_HOME<span style="color:#f92672">=</span>/oracle/app/product/19.3.0/db_1
</span></span><span style="display:flex;"><span>export ORACLE_SID<span style="color:#f92672">=</span>orcl1
</span></span><span style="display:flex;"><span>export PATH<span style="color:#f92672">=</span>$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>二节点：
</span></span><span style="display:flex;"><span>grid 
</span></span><span style="display:flex;"><span>用户：
</span></span><span style="display:flex;"><span>export ORACLE_BASE<span style="color:#f92672">=</span>/oracle/gridbase
</span></span><span style="display:flex;"><span>export ORACLE_HOME<span style="color:#f92672">=</span>/oracle/grid/crs_1
</span></span><span style="display:flex;"><span>export ORACLE_SID<span style="color:#f92672">=</span>+ASM2
</span></span><span style="display:flex;"><span>export PATH<span style="color:#f92672">=</span>$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>oracle用户：
</span></span><span style="display:flex;"><span>export ORACLE_BASE<span style="color:#f92672">=</span>/oracle/app
</span></span><span style="display:flex;"><span>export ORACLE_HOME<span style="color:#f92672">=</span>/oracle/app/product/19.3.0/db_1
</span></span><span style="display:flex;"><span>export ORACLE_SID<span style="color:#f92672">=</span>orcl2
</span></span><span style="display:flex;"><span>export PATH<span style="color:#f92672">=</span>$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
</span></span></code></pre></div><p>记得一定要做好分权，每个文件775,然后oracle我这边是属于root:oinstall</p>
<p>/oracle/app oracle:oinstall</p>
<p>/oracle/grid grid:oinstall</p>
<blockquote>
<p>我安装的时候反着装，所以我的节点一和节点2的ssid都是反着的，建议在后续安装在节点一操作</p>
</blockquote>
<h2 id="网络配置和规划">网络配置和规划</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>vim /etc/hosts
</span></span><span style="display:flex;"><span><span style="color:#75715e">#公网</span>
</span></span><span style="display:flex;"><span>192.168.18.211          rac1
</span></span><span style="display:flex;"><span>192.168.18.212          rac2
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#虚拟IP</span>
</span></span><span style="display:flex;"><span>192.168.18.213          rac1-vip
</span></span><span style="display:flex;"><span>192.168.18.214          rac2-vip
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#私有网络</span>
</span></span><span style="display:flex;"><span>10.10.10.211             rac1-priv
</span></span><span style="display:flex;"><span>10.10.10.212             rac2-priv
</span></span><span style="display:flex;"><span><span style="color:#75715e">#scanIP</span>
</span></span><span style="display:flex;"><span>192.168.18.215          rac-scan
</span></span></code></pre></div><p>这里需要体检添加并配置公网rac的网卡和私有网络的网卡，vip可以不用配置。(我看到公司的虚拟机有一个专用的vip我暂时没弄明白是否需要，但是这边教程找到的是只需要与公网同一个网段即可)</p>
<p>给任一网卡作为参考好了</p>
<pre tabindex="0"><code>[root@rac2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens224 
DEVICE=ens224
IPADDR=10.10.10.212
NETMASK=255.255.255.0
GATEWAY=192.168.18.1
ONBOOT=yes
DNS1=192.168.18.1
</code></pre><h2 id="检查时区是否一致">检查时区是否一致</h2>
<p>date -R</p>
<h2 id="这边虚拟机进行所以并未多路径软件安装">这边虚拟机进行，所以并未多路径软件安装。</h2>
<h2 id="安装介质准备一个节点就行另一个节点保持文件空">安装介质准备(一个节点就行，另一个节点保持文件空)</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>chown grid:oinstall LINUX.X64_193000_grid_home
</span></span><span style="display:flex;"><span>chmod <span style="color:#ae81ff">775</span> LINUX.X64_193000_grid_home
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>chown oracle:oinstall LINUX.X64_193000_db_home
</span></span><span style="display:flex;"><span>chmod <span style="color:#ae81ff">775</span> LINUX.X64_193000_db_home 
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>用grid用户解压介质
</span></span><span style="display:flex;"><span>unzip LINUX.X64_193000_grid_home -d $ORACLE_HOME
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>用oracle用户解压介质
</span></span><span style="display:flex;"><span>unzip LINUX.X64_193000_db_home -d $ORACLE_HOME
</span></span></code></pre></div><h2 id="调整好以上一切准备好x11的转发在本地安装图形化界面就可以开始图形化安装了也是单节点操作">调整好以上一切，准备好x11的转发/在本地安装图形化界面。就可以开始图形化安装了（也是单节点操作）</h2>
<p>没截图，不喜欢弄图床，所以图片均为外部引入
<img src="https://img-blog.csdnimg.cn/20200908095151974.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt="">
<img src="https://img-blog.csdnimg.cn/20200908095244901.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>这里设置为rac-scan</p>
<p><img src="https://img-blog.csdnimg.cn/20200908095407121.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>这里添加rac2,rac2-vip记得ssh链接输入密码（当然也可以手动配置ssh互信）</p>
<p><img src="https://img-blog.csdnimg.cn/20200908095533451.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>这里用use ASM磁盘组</p>
<p><img src="https://img-blog.csdnimg.cn/20200908101656760.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>把私网设置为asm和私有通信</p>
<p><img src="https://img-blog.csdnimg.cn/a5b2edf730eb40b8bc8a8dc730409995.png" alt=""></p>
<p>GIMR我是没装的，所以我选了否</p>
<p><img src="https://img-blog.csdnimg.cn/c3c5dbe310e147f39f85cb99642e454e.png" alt=""></p>
<h2 id="好了太好了到检查asm步骤了查asm填入路径devoracleasmdisks但在此之前我们要装一个asm磁盘组需要多节点都操作">好了，太好了到检查asm步骤了，查asm填入路径/dev/oracleasm/disks/*，但在此之前我们要装一个asm磁盘组（需要多节点都操作）</h2>
<p><img src="https://img-blog.csdnimg.cn/30de2594d18e4f24b4827bec90080a6d.png" alt=""></p>
<h2 id="首先vmware创建共享磁盘httpsblogcsdnnetzds00virtuearticledetails105560157可以直接参考文章来弄">首先<a href="https://blog.csdn.net/zds00virtue/article/details/105560157">vmware创建共享磁盘</a>,可以直接参考文章来弄</h2>
<p>这边口述一下步骤:开一个新SCSI控制器，总线控制选择虚拟。然后创建一个磁盘一定要选厚制备，独立持久，选择使用新的SCSI的控制器。另一边也是一样，开盘的时候选择现有磁盘就行了。</p>
<h2 id="asm磁盘组也可以参考asmlib创建asm磁盘组httpsblogcsdnnetshayuweiarticledetails90481922">asm磁盘组也可以参考<a href="https://blog.csdn.net/shayuwei/article/details/90481922">asmlib创建asm磁盘组</a></h2>
<p>有了虚拟磁盘就要用asmlib创建一个asm磁盘组，先装包</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>wget http://mirror.centos.org/centos/7/os/x86_64/Packages/kmod-oracleasm-2.0.8-28.el7.x86_64.rpm
</span></span><span style="display:flex;"><span>wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracleasm-support-2.1.11-2.el7.x86_64.rpm
</span></span><span style="display:flex;"><span>wget https://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el7.x86_64.rpm
</span></span><span style="display:flex;"><span>rpm -ivh 以上内容,听说有顺序，但是我是乱来的也能跑
</span></span><span style="display:flex;"><span>kmod-oracleasm oracleasm-support oracleasmlib
</span></span></code></pre></div><h2 id="asm配置">asm配置</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm configure -i</span>
</span></span><span style="display:flex;"><span>Configuring the Oracle ASM library driver.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>This will configure the on-boot properties of the Oracle ASM library
</span></span><span style="display:flex;"><span>driver.  The following questions will determine whether the driver is
</span></span><span style="display:flex;"><span>loaded on boot and what permissions it will have.  The current values
</span></span><span style="display:flex;"><span>will be shown in brackets <span style="color:#f92672">(</span><span style="color:#e6db74">&#39;[]&#39;</span><span style="color:#f92672">)</span>.  Hitting &lt;ENTER&gt; without typing an
</span></span><span style="display:flex;"><span>answer will keep that current value.  Ctrl-C will abort.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Default user to own the driver interface <span style="color:#f92672">[]</span>: grid
</span></span><span style="display:flex;"><span>Default group to own the driver interface <span style="color:#f92672">[]</span>: dba
</span></span><span style="display:flex;"><span>Start Oracle ASM library driver on boot <span style="color:#f92672">(</span>y/n<span style="color:#f92672">)</span> <span style="color:#f92672">[</span>n<span style="color:#f92672">]</span>: y
</span></span><span style="display:flex;"><span>Scan <span style="color:#66d9ef">for</span> Oracle ASM disks on boot <span style="color:#f92672">(</span>y/n<span style="color:#f92672">)</span> <span style="color:#f92672">[</span>y<span style="color:#f92672">]</span>: y
</span></span><span style="display:flex;"><span>Writing Oracle ASM library driver configuration: <span style="color:#66d9ef">done</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm status</span>
</span></span><span style="display:flex;"><span>Checking <span style="color:#66d9ef">if</span> ASM is loaded: no
</span></span><span style="display:flex;"><span>Checking <span style="color:#66d9ef">if</span> /dev/oracleasm is mounted: no
</span></span></code></pre></div><h2 id="查看完状态就可以init了">查看完状态就可以init了</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm init</span>
</span></span><span style="display:flex;"><span>Creating /dev/oracleasm mount point: /dev/oracleasm
</span></span><span style="display:flex;"><span>Loading module <span style="color:#e6db74">&#34;oracleasm&#34;</span>: oracleasm
</span></span><span style="display:flex;"><span>Configuring <span style="color:#e6db74">&#34;oracleasm&#34;</span> to use device physical block size
</span></span><span style="display:flex;"><span>Mounting ASMlib driver filesystem: /dev/oracleasm
</span></span></code></pre></div><h2 id="记得先分区磁盘选什么是什么">记得先分区磁盘选什么是什么</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>gdisk /dev/sdb
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Command <span style="color:#f92672">(</span>? <span style="color:#66d9ef">for</span> help<span style="color:#f92672">)</span>: n
</span></span><span style="display:flex;"><span><span style="color:#75715e">#其他可以全部default,自己搞定</span>
</span></span></code></pre></div><h2 id="不报错误就可以创建磁盘了">不报错误就可以创建磁盘了</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm createdisk ocl1 /dev/sdb1</span>
</span></span><span style="display:flex;"><span>Writing disk header: <span style="color:#66d9ef">done</span>
</span></span><span style="display:flex;"><span>Instantiating disk: <span style="color:#66d9ef">done</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac1 eql<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm listdisks</span>
</span></span><span style="display:flex;"><span>OCL1
</span></span></code></pre></div><h2 id="另一边进行一样的初始化最后不需要创建磁盘只需要执行">另一边进行一样的初始化，最后不需要创建磁盘，只需要执行：</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>root@rac2 ~<span style="color:#f92672">]</span><span style="color:#75715e"># oracleasm scandisks</span>
</span></span><span style="display:flex;"><span>Reloading disk partitions: <span style="color:#66d9ef">done</span>
</span></span><span style="display:flex;"><span>Cleaning any stale ASM disks...
</span></span><span style="display:flex;"><span>Scanning system <span style="color:#66d9ef">for</span> ASM disks..
</span></span><span style="display:flex;"><span><span style="color:#75715e">#按道理说这里会读到东西，我读过了就没有了</span>
</span></span></code></pre></div><p><strong>然后你的图形化界面就能看到磁盘啦！！！！</strong></p>
<p>密码你喜欢
<img src="https://img-blog.csdnimg.cn/20200908102250825.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt="">
不使用IPMI
<img src="https://img-blog.csdnimg.cn/20200908102323408.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt="">
<strong>我这里是不填的</strong>
<img src="https://img-blog.csdnimg.cn/20200908102343124.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt="">
你的权限和用户变量没有问题，且只有一边有文件，就可以正常安装不报错了，报错就看看上述问题
<img src="https://img-blog.csdnimg.cn/20200908102353460.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt="">
同理
<img src="https://img-blog.csdnimg.cn/20200908102406713.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>这个是自动执行脚本，要么你给root用户密码或者给sudoer用户密码，也可以自己来，无所谓。
<img src="https://img-blog.csdnimg.cn/20200908102416243.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>跑一下fix&amp;check again，让他自动修一下
<img src="https://img-blog.csdnimg.cn/20200908102733754.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ZhbnpodW96aHVv,size_16,color_FFFFFF,t_70#pic_center" alt=""></p>
<p>保证报错只留下resolv.conf和DNS问题NTP出问题也没事，也有文档可以包容Device Checks for ASM和Access Control List check，但是我就2个错误所以无视，继续</p>
<p>分别在rac1和rac2<strong>逐一且按顺序</strong>执行脚本orainstRoot.sh和root.sh</p>
<p>最后安装即可，我当时是报错了NTP出了问题，但是我直接跳了没事，最后查看一下GI状态：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>grid@rac2 ~<span style="color:#f92672">]</span>$ crsctl stat res -t
</span></span><span style="display:flex;"><span>--------------------------------------------------------------------------------
</span></span><span style="display:flex;"><span>Name           Target  State        Server                   State details       
</span></span><span style="display:flex;"><span>--------------------------------------------------------------------------------
</span></span><span style="display:flex;"><span>Local Resources
</span></span><span style="display:flex;"><span>--------------------------------------------------------------------------------
</span></span><span style="display:flex;"><span>ora.LISTENER.lsnr
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.chad
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.net1.network
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.ons
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>               ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>--------------------------------------------------------------------------------
</span></span><span style="display:flex;"><span>Cluster Resources
</span></span><span style="display:flex;"><span>--------------------------------------------------------------------------------
</span></span><span style="display:flex;"><span>ora.ASMNET1LSNR_ASM.lsnr<span style="color:#f92672">(</span>ora.asmgroup<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">2</span>        ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">3</span>        ONLINE  OFFLINE                               STABLE
</span></span><span style="display:flex;"><span>ora.DATA.dg<span style="color:#f92672">(</span>ora.asmgroup<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">2</span>        ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">3</span>        OFFLINE OFFLINE                               STABLE
</span></span><span style="display:flex;"><span>ora.LISTENER_SCAN1.lsnr
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.asm<span style="color:#f92672">(</span>ora.asmgroup<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     Started,STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">2</span>        ONLINE  ONLINE       rac1                     Started,STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">3</span>        OFFLINE OFFLINE                               STABLE
</span></span><span style="display:flex;"><span>ora.asmnet1.asmnetwork<span style="color:#f92672">(</span>ora.asmgroup<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">2</span>        ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">3</span>        OFFLINE OFFLINE                               STABLE
</span></span><span style="display:flex;"><span>ora.cvu
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.orcl.db
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     Open,HOME<span style="color:#f92672">=</span>/oracle/ap
</span></span><span style="display:flex;"><span>                                                             p/product/19.3.0/db_
</span></span><span style="display:flex;"><span>                                                             1,STABLE
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">2</span>        ONLINE  ONLINE       rac1                     Open,HOME<span style="color:#f92672">=</span>/oracle/ap
</span></span><span style="display:flex;"><span>                                                             p/product/19.3.0/db_
</span></span><span style="display:flex;"><span>                                                             1,STABLE
</span></span><span style="display:flex;"><span>ora.qosmserver
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.rac1.vip
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac1                     STABLE
</span></span><span style="display:flex;"><span>ora.rac2.vip
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>ora.scan1.vip
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">1</span>        ONLINE  ONLINE       rac2                     STABLE
</span></span><span style="display:flex;"><span>--------------------------------------------------------------------------------
</span></span></code></pre></div><p>除了ora.orcl.db应该都有。</p>
<h2 id="接下来就是软件的安装了准备x11转发清空一下oracleapp">接下来就是软件的安装了，准备x11转发，清空一下/oracle/app/</h2>
<p>算了，太长了，不弄图片了</p>
<p>选择只安装软件</p>
<p>选择第二个，集群安装oracle real application clusters database installation</p>
<p>老规矩，添加密码用图形化配置ssh互信</p>
<p>安装企业版enterprise edition</p>
<p>路径查看你oracle的base是否正确，这里报错一般跟你文件权限和里面有没有东西相关，请务必检查。</p>
<p>组就这样，下一步</p>
<p>还是root脚本，给root密码或者sudoer来跑脚本。或者自己来咯。</p>
<p>预检查都在预期内，fix&amp;check again跑完修一下。可以忽视resolv.conf，NTP的时间同步问题，DNS相关问题都可以忽视</p>
<p>安装。然后要么他帮你执行脚本，要么自己来，记得<strong>逐一且顺序</strong>db就装好了，sqlplus -v可以查看</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span><span style="color:#f92672">[</span>grid@rac2 ~<span style="color:#f92672">]</span>$ sqlplus -v
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>SQL*Plus: Release 19.0.0.0.0 - Production
</span></span><span style="display:flex;"><span>Version 19.3.0.0.0
</span></span></code></pre></div><h2 id="最后dbca开一个数据库就可以用了记得安装尽量别弄反在节点一装root先跑节点1">最后dbca开一个数据库就可以用了，记得安装尽量别弄反，在节点一装，root先跑节点1。</h2>
    </div>
    <footer class="content__footer"></footer>

            </section>

            <section class="page__aside">
                <div class="aside__about">
<div class="aside__about">
    <img class="about__logo" src="https://juruoxiao.gitee.io/linux_work/images/rice.svg" alt="Logo">
<h1 class="about__title">UxiaoTag</h1>
<p class="about__description">一个蒟蒻无比的萌新.</p>
</div>


<ul class="aside__social-links">
    
    <li>
        <a href="https://github.com/q2516631454" rel="me" aria-label="GitHub" title="GitHub"><i class="fa-brands fa-github" aria-hidden="true"></i></a>&nbsp;
    </li>
    
    <li>
        <a href="mailto:2516631454@qq.com" rel="me" aria-label="Email" title="Email"><i class="fa-solid fa-envelope" aria-hidden="true"></i></a>&nbsp;
    </li>
    
</ul>





<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/sakana-widget@2.5.0/lib/sakana.min.css"
/>
<div id="sakana-widget"></div>
<script>
  function initSakanaWidget() {
    const takina = SakanaWidget.getCharacter('takina');
    takina.initialState = {
      ...takina.initialState,
      i: 0.01,
      d: 1,
    };
    SakanaWidget.registerCharacter('takina-slow', takina);
    new SakanaWidget({ character: 'takina-slow',controls:false}).mount('#sakana-widget');
  }
</script>
<script
  async
  onload="initSakanaWidget()"
  src="https://cdn.jsdelivr.net/npm/sakana-widget@2.5.0/lib/sakana.min.js"
></script>
</div>
                <hr>
                <div class="aside__content">
    <p>搭一个基于RAC的多机Oracle</p>
    
        <p>
            By UxiaoTag, 
            2023-07-17
        </p>
    

                </div>
            </section>

            <footer class="page__footer"><p>
    
    
    
    
    
    
      
    
      
    
    
    
</p>
<br /><br />
<p class="copyright">© 2021–2022 <a href="https://gitee.com/juruoxiao/linux_work">UxiaoTag</a></p>
<p class="advertisement">Powered by <a href="https://gohugo.io/">hugo</a> and <a href="https://github.com/joeroe/risotto">risotto</a>.</p>
</footer>

        </div>
    </body>

</html>
